<?php

namespace App\Admin\Extensions;

use Encore\Admin\Admin;

class GuildOp extends BaseAction
{
    protected function render()
    {
        Admin::script($this->script($this->actionUrl));
        $okbtn = $this->buildButton('ok', '启用', ['id' => $this->id, 'status' => 1]);
        $delbtn = $this->buildButton('fail', '禁用', ['id' => $this->id, 'status' => 0]);
        $str = [''];
        if ($this->row->status == 1) {
            $str  = [$delbtn];
        } elseif ($this->row->status == 0) {
            $str  = [$okbtn];
        }
        return implode('<br/><br/>', $str);
    }
}
